<?php
	/*
	用户注册接口，注册成功返回该用户JSON数组
	测试方法
	http://localhost/web/api/register.php?account=xxx&password=xxxx&email=xxx
	*/
	include '../includes/common.inc.php';
	
	if(!class_exists('member'))
	{
		include_once MOD_ROOT.'member/includes/member.class.php';
	}
	$member = new member();
	
	
	$data = array(
		'username' => $account,
		'password' => $password,
		'email'    => $email
	);
	
	if($member->register($data))
	{
		echo json_encode(array(
			'status' => true,
			'data'   => $data,
			'msg'    => 'Successful registration'
		));
	}
	else
	{	
		echo json_encode(array(
			'status'  => false,
			'msg'  => 'Registration failed'
			));
	}
	
	
?>